#pragma once

#include <glad/glad.h>
#include <glm/glm.hpp>

class Texture {
 public:
  GLuint id;
 public:
  Texture();
  virtual ~Texture();
 public:
  bool loadPath(const GLchar *path);
  inline bool isOK() { return id != 0; }
  inline void free() { if (id) { glDeleteTextures(1, &id); id = 0; } }
 public:
  inline void use(GLenum units) {
    glActiveTexture(units);
    glBindTexture(GL_TEXTURE_2D, id);
  }
 protected:
  GLuint loadTexture(const GLchar *path);
};
